import pyautogui as pa
import time
pa.PAUSE = 0.02
pa.FAILSAFE = True
pw=""
tpw="123ac666"
while pw!=tpw:
    pw=pa.password(text='Please enter the password:', title='password', default='', mask='*')
    if(pw==None):
        quit()
    elif(pw!=tpw):
        pa.alert(text='password error', title='Error', button='OK')
pa.moveTo(x=100,y=1700,duration=0.4)
pa.click()
time.sleep(3)
if(sum(pa.locateOnScreen('chrome.png'))>75):
    pos=pa.locateOnScreen('title.png')
    pa.moveTo(x=pos[0],y=pos[1],duration=0.1)
    pa.doubleClick()
pa.moveTo(x=600,y=80,duration=0.25)
pa.click()
pa.typewrite("http://baidu.com\n",interval=0.05)
time.sleep(5)
search=pa.password(text='Please enter the image you want:', title='choose', default='', mask=None)
pa.moveTo(x=800,y=330,duration=0.1)
pa.click()
pa.typewrite(message=search+'\n',interval=0.1)
time.sleep(5)
pos=pa.locateOnScreen('image.png')
pa.moveTo(x=pos[0]+10,y=pos[1]+10,duration=0.25)
pa.click()
time.sleep(4)
for i in range(1):
    pa.moveTo(x=30,y=300,duration=0.1)
    pa.rightClick()
    pa.press('Shift','v')